package com.zhongjinkang.rhythm.AppView.Activity

import android.graphics.BitmapFactory
import android.net.Uri
import android.os.Bundle
import android.util.Log
import androidx.lifecycle.ViewModel
import com.zhongjinkang.rhythm.databinding.ActivityImageDetailBinding
import com.zhongjinkang.rhythm.viewModel.DetailImageViewModel
import java.net.URL

class ImageDetailActivity : BaseActivity<DetailImageViewModel, ActivityImageDetailBinding>(
    DetailImageViewModel::class.java,ActivityImageDetailBinding::inflate
) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    
        viewModel?.let {
            intent.getStringExtra("url")?.let { it1 -> it.addUrl(it1) }
        }




    }

    override fun toRefreshUI(viedModel: DetailImageViewModel?) {
        viedModel?.let { it ->
            it.bitmap.observe(this){

                binding.myImageView.originBitmap=it;
                binding.myImageView.setImageBitmap(it)

            }

        }
    }


}